 package uk.co.mmscomputing.device.twain;
 
 import java.util.Enumeration;
 import java.util.Vector;
 
 class TwainArray extends TwainContainer
 {
   int count;
   Vector items = new Vector();
 
   TwainArray(int paramInt, byte[] paramArrayOfByte) {
     super(paramInt, paramArrayOfByte);
     this.count = jtwain.getINT32(paramArrayOfByte, 2);
 
     int i = 0; for (int j = 6; i < this.count; i++) {
       this.items.add(getObjectAt(paramArrayOfByte, j));
       j += TwainConstants.typeSizes[this.type];
     }
   }
 
   int getType()
   {
     return 3;
   }
   byte[] getBytes() {
     int i = this.items.size();
     int j = 6 + i * TwainConstants.typeSizes[this.type];
     byte[] arrayOfByte = new byte[j];
     jtwain.setINT16(arrayOfByte, 0, this.type);
     jtwain.setINT32(arrayOfByte, 2, i);
 
     int k = 0; for (int m = 6; k < i; k++) {
       setObjectAt(arrayOfByte, m, this.items.get(k));
       m += TwainConstants.typeSizes[this.type];
     }
     return arrayOfByte;
   }
 
   public Object getCurrentValue() throws TwainIOException {
     throw new TwainIOException(getClass().getName() + ".getCurrentValue:\n\tnot applicable");
   }
 
   public void setCurrentValue(Object paramObject) throws TwainIOException {
     throw new TwainIOException(getClass().getName() + ".setCurrentValue:\n\tnot applicable");
   }
 
   public Object getDefaultValue() throws TwainIOException {
     throw new TwainIOException(getClass().getName() + ".getDefaultValue:\n\tnot applicable");
   }
 
   public void setDefaultValue(Object paramObject) throws TwainIOException {
     throw new TwainIOException(getClass().getName() + ".setDefaultValue:\n\tnot applicable");
   }
   public Object[] getItems() {
     return this.items.toArray();
   }
   public String toString() {
     String str = super.toString();
     str = str + "count        = " + this.count + "\n";
 
     Enumeration localEnumeration = this.items.elements();
     for (int i = 0; localEnumeration.hasMoreElements(); i++) {
       str = str + "items[" + i + "] = " + localEnumeration.nextElement() + "\n";
     }
     return str;
   }
 }

